package dragon

import (
	"http"
	"template"

	"appengine"
)

func handleDocuments(w http.ResponseWriter, r *http.Request) {
	c := appengine.NewContext(r)
	ts := new(template.Set)
	troot, _ := template.New("root").
		Funcs(template.FuncMap{
			"date": stuffDate,
		}).
		ParseFile("templates/root.html")
	tcontent, _ := template.New("content").
		ParseFile("templates/documents.html")
	ts.Add(troot, tcontent)
	ts.Execute(w, "root", map[string]interface{}{"Site": count(c, r, w),})
}
